<?php
namespace App\Http\Controllers;

use App\Models\city as citys;

class city extends Controller
{
   public function city()
   {
       $city = new citys();
       $category = $city -> with('allChildren')->get();
       $arr = [];
       foreach($category as $v)
       {
           if($v->pid==0){
               $arr[] = $v;
           }
       }
       return $arr;
   }
}
